package com.ymttest.database.mapping;

import com.shop2cn.iapi.agentproducts.parameter.CatalogPriceDto;
import com.ymttest.database.model.YmtCatalogsI;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

//商品合库 新库
public interface YmtCatalogsIMapper {
    
	List<YmtCatalogsI> selectCatalogsByProductId(Integer sProductId);
	
	List<Map> selectCatalogsByUserIdandSku(Map m);
	List<Map> selectProductPictureByProductId(String sProductId);
	List<Map> selectProductDescConfigWordByProductId(String sProductId);
	
	//查询商品最大最小单价
	List<Map> selectMinfQuotePrice(String sproductid);
	List<Map> selectMaxfQuotePrice(String sproductid);
	//查询商品总数
	List<Map> selectSumStock(String sproductid);
	
	//更新库存
	int updatestocknumByProductID(int iNum , String productID);
	/**
	 * @param iNum
	 * @param catalog
	 * @return
	 */
	@Update("update Ymt_Catalogs set iNum=#{iNum} where sCatalogId = #{catalog}")
	int updatestocknumByCatalogID(Map m);
	List<Map> selectCatalognamesforonelogs(Map m);
	List<Map> selectCatalognamesfortwologs(Map m);
	List<Map> selectCatalogsByProductIdforMap(String sProductId);
	int updateCatalogTypeByProductId(String productId,int catalogType);
	
	//根据商品id和sku查询
	List<Map> selectCatalogsByProductIdandSku(String sProductId , String sSKU);
	
	List<Map> selectProductIdBySku(String Sku);
	
	YmtCatalogsI selectCatalogsByCatalogId(String catalogId);
	int updateiActionByCatalogId(int action,String catalogId);

	List<CatalogPriceDto> getPriceByCatalogIds(List<String> catalogIds);

	@Select("select * from Ymt_CatalogSetAttributes where sCatalogId = #{sCatalogId}")
	List<Map> selectCatalogSetAttributesByCatalogId(Map map);
	@Select("select * from Ymt_Catalogs where ParentCatalogId = #{catalogId}")
	List<YmtCatalogsI> selectCatalogsByParentCatalogId(Map map);
	@Select("select * from Ymt_Catalogs where RootCatalogId = #{catalogId}")
	List<YmtCatalogsI> selectCatalogsByRootCatalogId(Map map);
}